<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>你的成绩</h1>
        <component1 :score="50">50</component1:score>
            <component1 :score="96">50</component1:score>
    </div>
    <script>
        Vue.component('component1',{
            props:['score'],
            template:`
            <div>
              {{score}}分, {{testResult}}  
            </div>
            `,
            computed:{
                testResult:function(){
                    var strResult="";
                    if(sore<60)
                    strResult="不及格";
                    else if(this.score<90)
                    strResult="中等生";
                    else if(this.score<=100)
                    strResult="优秀生";
                    return strResult;

                }
            }
        })
        var vm=new Vue({
            el:'#app',
            data:{
                
            },
            methods:{

            }
        })
            
           
            
    </script>
</body>

</html>